<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>客户管理</title>
<link th:href="@{/css/style.css}" rel="stylesheet" type="text/css" />
<script type="text/javascript" th:src="@{/js/jquery.js}"></script>

<body>
<div class="place"> <span>位置：</span>
  <ul class="placeul">
    <li>营销管理</li>
    <li>订购单审核管理</li>
    <li>基本内容</li>
  </ul>
</div>
<div class="rightinfo">
  <form id="form" action="/erp/market/orderExamine/findPageAll" method="post">
    <input type="hidden" id="pageNum" name="pageNum"/>
    <ul class="tools">
      <li> 订单编号:
        <input placeholder="请输入编号" type="text" name="orderid" th:value="${orders==null?'':orders.orderid}"/>
      </li>
      <li> 客户姓名:
        <input placeholder="请输入姓名" type="text" name="customname" th:value="${customname}" />
      </li>
      <li> 订购时间:
        <input type="date" name="datemin" th:value="${dateMin}"/>
        -
        <input type="date" name="datemax" th:value="${dateMax}"/>
      </li>

      <li> 金额:
        <input placeholder="0.0" type="text" class="stinput" name="priceMin" th:value="${priceMin}" />
        -
        <input placeholder="0.0" type="text" class="stinput" name="priceMax" th:value="${priceMax}" />
      </li>
      <li class="subBut" onclick="tiaoZhuan(1)"><img th:src="@{/images/t06.png}" />查询</li>
      <li class="subBut" onclick="qingkong()"><img th:src="@{/images/t03.png}" />重置</li>
      <script>
        function qingkong() {
          $("input[name=datemin]").val("");
          $("input[name=datemax]").val("");
          $("input[name=orderid]").val("");
          $("input[name=customname]").val("");
          $("input[name=priceMin]").val("");
          $("input[name=priceMax]").val("");
        }
      </script>
    </ul>
    <table class="tablelist">
      <thead>
        <tr>
          <th>序号</th>
          <th>订单编号</th>
          <th>客户姓名</th>
          <th>联系电话</th>
          <th>订购时间</th>
          <th>金额</th>
          <th>操作人</th>
          <th>审核状态</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        <tr th:each="o,i :${pb.list}">
          <td th:text="${(pb.pageNum-1)*pb.pageSize+i.count}">1</td>
          <td th:text="${o.orderid}">DJ201701270001</td>
          <td th:text="${o.custom.customname}">王金平</td>
          <td th:text="${o.custom.telephone}">17370899727</td>
          <td th:text="${o.ordertime}">2017-01-25 15:05:05</td>
          <td th:text="'￥'+${o.ordermoney}">9,876,582</td>
          <td th:text="${o.operatorUser.uname}">关羽</td>
          <td>审核中</td>
          <td>
            <a th:if="${o.checkid==session.users.uId}" th:href="@{'/market/orderExamine/goAuditOrder?orderid='+${o.orderid}}" class="tablelink">审核</a>
          </td>
        </tr>

      </tbody>
    </table>
    <div class="pagin">
      <div class="message">共<i class="blue" th:text="${pb.total}">1256</i>条记录，当前显示第&nbsp;<i class="blue"
                                                                                            th:text="${pb.pageNum}">2&nbsp;</i>页
      </div>
      <ul class="paginList">
        <li class="paginItem">
          <a href="javascript:void(0);" th:onclick="tiaoZhuan([[${pb.isFirstPage?1:pb.pageNum-1}]])">
            <span th:class="${pb.isFirstPage?'pagepre':'pagenxt roate'}"></span>
          </a>
        </li>

        <li class="paginItem" th:if="${1+4<=pb.pageNum}"><a th:onclick="tiaoZhuan(1)"
                                                            href="javascript:void(0);">1</a></li>
        <li class="paginItem more" th:if="${1+5<=pb.pageNum}"><a href="javascript:void(0);">...</a></li>
        <li class="paginItem" th:if="${1+3<=pb.pageNum}"><a th:onclick="tiaoZhuan([[${pb.pageNum-3}]])"
                                                            href="javascript:void(0);"
                                                            th:text="${pb.pageNum-3}">3</a></li>
        <li class="paginItem" th:if="${1+2<=pb.pageNum}"><a th:onclick="tiaoZhuan([[${pb.pageNum-2}]])"
                                                            href="javascript:void(0);"
                                                            th:text="${pb.pageNum-2}">4</a></li>
        <li class="paginItem" th:if="${1+1<=pb.pageNum}"><a th:onclick="tiaoZhuan([[${pb.pageNum-1}]])"
                                                            href="javascript:void(0);"
                                                            th:text="${pb.pageNum-1}">1</a></li>

        <li class="paginItem current"><a href="javascript:void(0);" th:text="${pb.pageNum}">2</a></li>

        <li class="paginItem" th:if="${pb.pages-1>=pb.pageNum}"><a th:onclick="tiaoZhuan([[${pb.pageNum+1}]])"
                                                                   href="javascript:void(0);"
                                                                   th:text="${pb.pageNum+1}">3</a></li>
        <li class="paginItem" th:if="${pb.pages-2>=pb.pageNum}"><a th:onclick="tiaoZhuan([[${pb.pageNum+2}]])"
                                                                   href="javascript:void(0);"
                                                                   th:text="${pb.pageNum+2}">4</a></li>
        <li class="paginItem" th:if="${pb.pages-3>=pb.pageNum}"><a th:onclick="tiaoZhuan([[${pb.pageNum+3}]])"
                                                                   href="javascript:void(0);"
                                                                   th:text="${pb.pageNum+3}">5</a></li>
        <li class="paginItem more" th:if="${pb.pages-5>=pb.pageNum}"><a href="javascript:void(0);">...</a></li>
        <li class="paginItem" th:if="${pb.pages-4>=pb.pageNum}"><a th:onclick="tiaoZhuan([[${pb.pages}]])"
                                                                   href="javascript:void(0);"
                                                                   th:text="${pb.pages}">10</a></li>

        <li class="paginItem">
          <a href="javascript:void(0);" th:onclick="tiaoZhuan([[${pb.isLastPage?pb.pages:pb.pageNum+1}]])">
            <span th:class="${pb.isLastPage?'pagepre roate ':'pagenxt '}"></span>
          </a>
        </li>
      </ul>
    </div>
  </form>
  <script>
    function tiaoZhuan(pageNum) {
      $("#pageNum").val(pageNum);
      $("#form").submit();
    }
  </script>
</div>
<script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
</script>
</body>
</html>
